package com.example.gaoyang.enums;

public enum ResultEnum {
    SUCCESS(0, "成功"),
    REQUEST_SUCCESS(200, "成功"),
    ERROR(500, "服务器异常"),
    SYSTEM_ERROR(500, "系统异常,需要相关人员处理!"),
    UNKNOWN_ERR(-1, "未知错误"),
    PARAM_ERROR(400, "参数校验失败"),
    NOT_FOUND(404, "404 没找到请求"),
    FAILURE(400, "业务异常"),
    UN_AUTHORIZED(401, "请求未授权"),
    CLIENT_UN_AUTHORIZED(401, "客户端请求未授权"),
    MSG_NOT_READABLE(400, "消息不能读取"),
    METHOD_NOT_SUPPORTED(405, "不支持当前请求方法"),
    MEDIA_TYPE_NOT_SUPPORTED(415, "不支持当前媒体类型"),
    REQ_REJECT(403, "请求被拒绝"),
    PARAM_MISS(400, "缺少必要的请求参数"),
    PARAM_TYPE_ERROR(400, "请求参数类型错误"),
    PARAM_BIND_ERROR(400, "请求参数绑定错误"),
    PARAM_VALID_ERROR(400, "参数校验失败"),
    TOKEN_VALID_ERROR(10001, "TOKEN校验失败"),
    TOKEN_VALID_MISS(10002, "TOKEN信息缺失"),
    TOKEN_VALID_EXPIRE(10003, "TOKEN失效"),
    USER_MISS(20001, "用户不存在"),
    USER_EXISTS(20001, "用户已存在"),
    FAIL_TO_ADD(20002, "添加失败"),
    FAIL_TO_MODIFY(20003, "修改失败"),
    FAIL_TO_DELETE(20004, "删除失败"),
    FILE_UPLOAD_ERROR(20005, "文件上传失败"),
    PASSWORD_ERROR(20006, "用户名密码错误"),
    ;

    private final Integer code;
    private final String msg;

    ResultEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return this.code;
    }

    public String getMsg() {
        return this.msg;
    }
}
